using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace LockImage.Utils
{
    public class IOUtils
    {
        public static void WriteToFile(Stream streamToWrite, String filePath)
        {
            FileStream fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write);
            int data;

            while ((data = streamToWrite.ReadByte()) != -1)
            {
                fileStream.WriteByte((byte)data);
            }
            fileStream.Close();
            fileStream = null;
        }
    }
}
